<template>
	<view class="content">
		<view class="logo">

		</view>
		<view class="paihangbang">

		</view>
		<view class="paihang-box" :class="current==0?'paihang-box1':'paihang-box2'">
			<view class="xuanshoubang" :class="current==0?'active':''" @click="qiehuan(0)">
				选手榜
			</view>
			<view class="changwaibang" :class="current==1?'active':''" @click="qiehuan(1)">
				场外观众榜
			</view>
			<view class="list-box">
				<view v-for="(item,index) in paihangList" :key="index" class="list-item">
					{{item.name}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				paihangList: []
			};
		},
		onShow() {
			this.getpaihang(0)
		},
		methods: {
			qiehuan(index) {
				this.current = index
				this.getpaihang(index)
			},
			getpaihang(index) {
				uniCloud.callFunction({
					name: 'get-paihang',
					data: {
						index: index
					}
				}).then(res => {
					console.log(res)
					this.paihangList = res.result.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: url('@/static/bg.png') no-repeat center top;
		background-size: 100% 100%;
		// height: 1624rpx;
		background-attachment: fixed;
	}

	.paihangbang {
		width: 548rpx;
		height: 108rpx;
		background: url('@/static/paihangbang.png') no-repeat center center;
		background-size: 100% 100%;
		margin-top: 130rpx;
	}

	.paihang-box {
		// display: flex;
		// flex-direction: column;
		// align-items: center;
	}

	.paihang-box1 {
		width: 564rpx;
		height: 582rpx;
		background: url('@/static/bg1.png') no-repeat center center;
		background-size: 100% 100%;
		margin-top: 64rpx;
	}

	.paihang-box2 {
		width: 564rpx;
		height: 582rpx;
		background: url('@/static/bg2.png') no-repeat center center;
		background-size: 100% 100%;
		margin-top: 64rpx;
	}

	.xuanshoubang.active {
		width: 282rpx;
		height: 78rpx;
		background: url('@/static/xuanzhongtab.png') no-repeat center center;
		background-size: 100% 100%;
		float: left;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
		font-size: 16px;
		line-height: 16px;
		font-weight: bold;
	}

	.xuanshoubang {
		width: 282rpx;
		height: 78rpx;
		float: left;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #606060;
		font-size: 16px;
		line-height: 16px;
		font-weight: bold;
	}

	.changwaibang {
		width: 282rpx;
		height: 78rpx;
		float: right;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #606060;
		font-size: 16px;
		line-height: 16px;
		font-weight: bold;
	}

	.changwaibang.active {
		width: 282rpx;
		height: 78rpx;
		background: url('@/static/xuanzhongtab.png') no-repeat center center;
		background-size: 100% 100%;
		float: right;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #fff;
		font-size: 16px;
		line-height: 16px;
		font-weight: bold;
	}

	.list-box {
		width: 496rpx;
		height: 426rpx;
		// overflow: hidden;
		overflow-y: scroll;
		// display: flex;
		// flex-direction: column;
		// align-items: center;
		margin: 0 auto;
		margin-top: 110rpx;
	}

	.list-item {
		width: 488rpx;
		height: 88rpx;
		background: url('@/static/paihangban.png') no-repeat center center;
		background-size: 100% 100%;
		margin-bottom: 20rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		line-height: 88rpx;
		font-weight: 800;
	}
</style>
